<?php
namespace App\Services\ThirdPayments\BankTraits;

use App\Lib\BankMap;

trait F1CardBankMap
{
    private $bankMap = [
        BankMap::GONGSHANG    => 'ICBC',
        BankMap::JIANSHE      => 'CCB',
        BankMap::NONGYE       => 'ABC',
        BankMap::ZHAOSHANG    => 'CMB',
        BankMap::JIAOTONG     => 'COMM',
        BankMap::MINSHENG     => 'CMBC',
        BankMap::XINGYE       => 'CIB',
        BankMap::YOUZHEN      => 'PSBC',
        BankMap::CHINABANK    => 'BOC',
        BankMap::HUAXIA       => 'HXB',
        BankMap::NINGBO       => 'NBCB',
        BankMap::PINGAN       => 'SZPAB',
        BankMap::PUFA         => 'SPDB',
        BankMap::GUANGFA      => 'GDB',
        BankMap::GUANGDA      => 'CEB',
        BankMap::ZHONGXIN     => 'CITIC'
    ];

    public function getBank($bankCode)
    {
        if (array_key_exists($bankCode, $this->bankMap)) return $this->bankMap[$bankCode];
        else return 'ICBC';
    }
}
